﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using CrossLayerCommunication.FluentValidation;

namespace UnitTest.FluentValidation
{
    [TestClass]
    public class TestEqaulity
    {
        [TestMethod]
        public void TestIsEqualTo()
        {
            //arrange
            int valueToTest = 10;           

            //act, assert
            Assert.IsTrue(valueToTest.TestingFluentValidation().IsEqualTo(10).ValidationWasSuccessful);
            Assert.IsTrue(valueToTest.TestingFluentValidation().IsEqualTo(Convert.ToInt16(10)).ValidationWasSuccessful);            
            Assert.IsFalse(valueToTest.TestingFluentValidation().IsEqualTo(11).ValidationWasSuccessful);            
        }

        [TestMethod]
        public void TestIsNotEqualTo()
        {
            //arrange
            int valueToTest = 10;

            //act, assert
            Assert.IsFalse(valueToTest.TestingFluentValidation().IsNotEqualTo(10).ValidationWasSuccessful);
            Assert.IsFalse(valueToTest.TestingFluentValidation().IsNotEqualTo(Convert.ToInt16(10)).ValidationWasSuccessful);
            Assert.IsTrue(valueToTest.TestingFluentValidation().IsNotEqualTo(11).ValidationWasSuccessful);
        }
    }
}
